package com.chj.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.chj.entity.Message;
import com.chj.util.ResultSetUtil;
import com.etc.jdbc.mapper.RowMapper;

public class MessageMapper implements RowMapper<Message> {

    @Override
    public Message mapRow(ResultSet rs) throws SQLException {

        Message message = new Message();

        message.setMessageId(ResultSetUtil.getString(rs, "massage_id"));
        message.setMessageMsg(ResultSetUtil.getString(rs, "massage_msg"));
        message.setUserId(ResultSetUtil.getString(rs, "user_id"));
        message.setCreateDate(ResultSetUtil.getDateTime(rs, "create_date"));
        message.setModifyDate(ResultSetUtil.getDateTime(rs, "modify_date"));
        message.setDeleteDate(ResultSetUtil.getDateTime(rs, "delete_date"));
        message.setStatus(ResultSetUtil.getInt(rs, "status"));

        return message;
    }

}
